"use strict";

module.exports = ({ strapi }) => ({
  index(ctx) {
    ctx.body = strapi
      .plugin("my-plugin-a")
      .service("myService")
      .getWelcomeMessage();
  },

  async getWelcomeMessage(ctx) {
    try {
      ctx.body = await strapi
        .plugin("my-plugin-a")
        .service("myService")
        .getWelcomeMessage();
    } catch (err) {
      ctx.body = err;
    }
  },
});
